import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

// 引用 vant
import vant from 'vant'
import 'vant/lib/index.css'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control
// 引入 rem 配置
import '@/utils/rem.js'
// 桌面端自动将 mouse 事件转换成对应的 touch 事件
import '@vant/touch-emulator'

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */

// 关闭 mock 仅在正式环境启用
const { mockXHR } = require('../mock')
mockXHR()

// 导入全部 vant 组件
Vue.use(vant)

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
